The document summarizes the agenda and topics covered at the RailsWayCon 2009 conference in Berlin. The conference included sessions on asynchronous processing in Ruby, HAML/SASS templating, migrating to JRuby, Rails performance optimization, frontend optimization with jQuery, and other topics. Speakers discussed using tools like RabbitMQ for asynchronous jobs, HAML for cleaner markup, SASS for CSS frameworks, and jQuery for interactive JavaScript.
1. begin
RailsWayCon.new
...
Zusammenfassung der Ruby on Rails
Konferenz 2009 in Berlin
Daniel Mattes, 4. Juni 2009
2. Über mich
Daniel Mattes
Angestellter bei der BurdaWireless GmbH
email: dm@actsasblog.de
http://www.xing.com/profile/Daniel_Mattes2
http://www.actsasblog.de
04.06.2009 RailsWayCon 2009 2
4. Asynchronous Processing in Ruby
Title: The State of Asynchronous
Processing in Ruby - Mathias Meyer
Slides:
http://www.paperplanes.de/2009/5/27/rails
waycon_slides.html
Links
http://github.com/ezmobius/nanite/tree/master
http://www.rabbitmq.com/
http://github.com/tobi/delayed_job/tree/master
04.06.2009 RailsWayCon 2009 4
5. Asynchronous Processing in Ruby
When?
Requests are taking too long
Tasks on a certain time
Longer running tasks
04.06.2009 RailsWayCon 2009 5
6. Asynchronous Processing in Ruby
Nanite (the big one)
Using RabbitMQ
Scalling
Build in error/exceptions reports
Recommendations
simple
delayed_jobs
distributed
When using EC2 -> Amazon SQS
heavy load, scalable
Nanite/RabbitMQ
04.06.2009 RailsWayCon 2009 6
7. HAML/SASS/COMPASS
Title: Show the Frontend some Love:
HAML and SASS - Jan Krutisch
Slides:
http://www.slideshare.net/jan_mindmatters
/haml-sass-and-compass
Links
http://haml.hamptoncatlin.com/
http://haml.hamptoncatlin.com/docs/rdoc
04.06.2009 RailsWayCon 2009 7
9. HAML
HAML
outputs beautiful code
gem install haml
automatically creates self-closing tags for img, br,...
attributes
ruby hash syntax: %head{ :language => 'german'}
& html_escape
can be set as default
== interpolates ruby strings
-= don't output, e. g. for .each
automated id generation: %li[obj] <li id=obj.id.....
/ output html comments
you can migrate your erb step by step
04.06.2009 RailsWayCon 2009 9
11. SASS
SASS
installation: its included in haml
you can create nested styles
you can create constants
can do calculations
mixins, by using = for definition, + for usage
you can use loops
04.06.2009 RailsWayCon 2009 11
13. Migration to JRuby
Title: The Pleasure and Pain of Migrating
to jRuby - Steven Bristol
Why switch?
performance
scalability
java api
04.06.2009 RailsWayCon 2009 13
14. Migration to JRuby
Problems:
Gems like ferret, file_column take other
solutions
Deployment with Glassfish
Complicated
much slower than with mongrel
Recommendation
If you don‘t need to convert your hole app,
just build a small application which exposes a
rest interface.
04.06.2009 RailsWayCon 2009 14
15. Rails Performance
Title: Rails Performance - Michael
Koziarski
first focus to frontend performance
yslow: http://developer.yahoo.com/yslow/
javascript_include_tag:defaults, :cache =>
true
My suggestion
http://github.com/yolk/rucksack/tree/master
It‘s a packer like asset_package, asset_compressor
sprite your images:
http://websitetips.com/articles/css/sprites/
04.06.2009 RailsWayCon 2009 15
16. Rails Performance
1. What is slow?
heavily used?
cache
etags
last updated header
Expires header
browser don't look for a specific time
fresh_when
04.06.2009 RailsWayCon 2009 16
18. Rails Performance
3. Improve it
often used image create image tag
manually
look at url generators
look at garbage collection
RUBY_HEAP_MIN_SLOTS
RUBY_GC_MALLOC_LIMIT
RUBY_HEAP_FREE_MIN
04.06.2009 RailsWayCon 2009 18
19. Rails Performance
At least…
you can start to cache, scale, db
partitioning,…
http://railslab.newrelic.com/scaling-rails
04.06.2009 RailsWayCon 2009 19
20. Frontend Optimazation
Title: Boost your Website's Performance
with Frontend Optimization - Ralph von
der Heyden
Slides:
http://www.slideshare.net/ralphvdh/front-
end-performance-railswaycon-2009-short-
talk
04.06.2009 RailsWayCon 2009 20
21. Frontend Optimazation
Why?
e. g. Amazon sells 1% less stuff per 100ms
more loading time
Backend: 10 % loading time
Frontend: 90 % loading time
Who?
Fewer Requests
Smaller Requests
Speed up Requests
04.06.2009 RailsWayCon 2009 21
23. Frontend Optimazation
Smaller requests
gzip your text
Apache: mod_deflate
minify js and css
images
png is usually smaller than gif
strip JPG meta data
http://smush.it/
04.06.2009 RailsWayCon 2009 23
24. Frontend Optimazation
Speed up requests
most browsers load 2 files per host
Multiple domains for static content
Rails: Set 4 asset hosts 8 parallel
downloads
config.action_controller.asset_host =
„http://assets%d.foobar.com“
Content Delivery Networks for static files
04.06.2009 RailsWayCon 2009 24
26. jQuery
Title: jQuery with Rails - Yehuda Katz
Slides: http://yehudakatz.com/wp-
content/uploads/2009/05/jquerytutorial.pdf
Links
http://docs.jquery.com/Main_Page
Why?
Write less, do more!
Separation of JavaScript and HTML
A lot of plugins
04.06.2009 RailsWayCon 2009 26
31. Others
Ruby sittin on the Couch - Alexander Lang
http://www.slideshare.net/langalex/ruby-sittin-
on-the-couch
it uses javascript
restful http interface
it scales
optimistic locking
replication
written in erlang
it saves json
04.06.2009 RailsWayCon 2009 31
32. Others
From Rails to Rack: Making Rails 3 a
better Ruby Citizen - Yehuda Katz
http://pivotallabs.com/users/woosley/blog/artic
les/878-from-rails-to-rack-making-rails-3-a-
better-ruby-citizen-yehuda-katz-
Features
Middleware
rack-tests
different ORMs (ActiveRecord, DataMapper,…)
Javascript no more Prototype-specefic (jQuery,
Mootools,…)
faster Filters and Controllers
04.06.2009 RailsWayCon 2009 32
33. Others
Ruby/Rails in the Enterprise - Maik
Schmidt
xml
use libxml for xml operations
implemented in c
very fast
you can validate by schema
internationalization
04.06.2009 RailsWayCon 2009 33